import java.sql.*;

public class TestUpdate {
	public static void main(String[] args) throws Exception {
	
		Connection connection = DriverManager.getConnection(Constants.DB_URL, Constants.USER, Constants.PASSWORD);
		PreparedStatement statement = connection.prepareStatement("UPDATE users SET name=? WHERE userid=?");
		statement.setString(1, "Pablo On");
		statement.setInt(2, 3);
		int rowsAffected = statement.executeUpdate();
		
		connection.close();
		
		System.out.println(rowsAffected + " rows affected");
	}
}
